package com.rivulet.dawn.api.common;


import java.util.HashMap;
import java.util.Map;

public enum TaskStatusEnum {
    WAITING(0, "等待"),
    RUNNING(1, "运行"),
    EXCEPTION(2, "异常"),
    SUCCESS(3, "成功"),
    ERROR(4, "错误"),
    CLEAN(9, "清除");


    public int statusValue;
    public String statusDesc;

    private TaskStatusEnum(int statusValue, String statusDesc) {
        this.statusValue = statusValue;
        this.statusDesc = statusDesc;
    }

    private static Map<Integer, TaskStatusEnum> map = new HashMap();

    public static TaskStatusEnum getEnumByCode(Integer code) {
        TaskStatusEnum value = (TaskStatusEnum) map.get(code);
        if (value == null) {
            value = EXCEPTION;
        }
        return value;
    }

    static {
        TaskStatusEnum[] var0 = values();
        int var1 = var0.length;
        for (int var2 = 0; var2 < var1; ++var2) {
            TaskStatusEnum item = var0[var2];
            map.put(item.statusValue, item);
        }
    }
}
